/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.mad.bikepony.service.persistence;

import com.liferay.portal.service.persistence.BasePersistence;

import com.mad.bikepony.model.Agent;

/**
 * The persistence interface for the agent service.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author nicola
 * @see AgentPersistenceImpl
 * @see AgentUtil
 * @generated
 */
public interface AgentPersistence extends BasePersistence<Agent> {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this interface directly. Always use {@link AgentUtil} to access the agent persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
	 */

	/**
	* Caches the agent in the entity cache if it is enabled.
	*
	* @param agent the agent
	*/
	public void cacheResult(com.mad.bikepony.model.Agent agent);

	/**
	* Caches the agents in the entity cache if it is enabled.
	*
	* @param agents the agents
	*/
	public void cacheResult(java.util.List<com.mad.bikepony.model.Agent> agents);

	/**
	* Creates a new agent with the primary key. Does not add the agent to the database.
	*
	* @param agentId the primary key for the new agent
	* @return the new agent
	*/
	public com.mad.bikepony.model.Agent create(long agentId);

	/**
	* Removes the agent with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param agentId the primary key of the agent
	* @return the agent that was removed
	* @throws com.mad.bikepony.NoSuchAgentException if a agent with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Agent remove(long agentId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchAgentException;

	public com.mad.bikepony.model.Agent updateImpl(
		com.mad.bikepony.model.Agent agent, boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the agent with the primary key or throws a {@link com.mad.bikepony.NoSuchAgentException} if it could not be found.
	*
	* @param agentId the primary key of the agent
	* @return the agent
	* @throws com.mad.bikepony.NoSuchAgentException if a agent with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Agent findByPrimaryKey(long agentId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchAgentException;

	/**
	* Returns the agent with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param agentId the primary key of the agent
	* @return the agent, or <code>null</code> if a agent with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Agent fetchByPrimaryKey(long agentId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the agent where agentId = &#63; and password = &#63; or throws a {@link com.mad.bikepony.NoSuchAgentException} if it could not be found.
	*
	* @param agentId the agent ID
	* @param password the password
	* @return the matching agent
	* @throws com.mad.bikepony.NoSuchAgentException if a matching agent could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Agent findByAgentIdAndPassword(long agentId,
		java.lang.String password)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchAgentException;

	/**
	* Returns the agent where agentId = &#63; and password = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
	*
	* @param agentId the agent ID
	* @param password the password
	* @return the matching agent, or <code>null</code> if a matching agent could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Agent fetchByAgentIdAndPassword(
		long agentId, java.lang.String password)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the agent where agentId = &#63; and password = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
	*
	* @param agentId the agent ID
	* @param password the password
	* @param retrieveFromCache whether to use the finder cache
	* @return the matching agent, or <code>null</code> if a matching agent could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Agent fetchByAgentIdAndPassword(
		long agentId, java.lang.String password, boolean retrieveFromCache)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns all the agents where status = &#63;.
	*
	* @param status the status
	* @return the matching agents
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.mad.bikepony.model.Agent> findByState(int status)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the agents where status = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param status the status
	* @param start the lower bound of the range of agents
	* @param end the upper bound of the range of agents (not inclusive)
	* @return the range of matching agents
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.mad.bikepony.model.Agent> findByState(
		int status, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the agents where status = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param status the status
	* @param start the lower bound of the range of agents
	* @param end the upper bound of the range of agents (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching agents
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.mad.bikepony.model.Agent> findByState(
		int status, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the first agent in the ordered set where status = &#63;.
	*
	* @param status the status
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching agent
	* @throws com.mad.bikepony.NoSuchAgentException if a matching agent could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Agent findByState_First(int status,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchAgentException;

	/**
	* Returns the first agent in the ordered set where status = &#63;.
	*
	* @param status the status
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching agent, or <code>null</code> if a matching agent could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Agent fetchByState_First(int status,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the last agent in the ordered set where status = &#63;.
	*
	* @param status the status
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching agent
	* @throws com.mad.bikepony.NoSuchAgentException if a matching agent could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Agent findByState_Last(int status,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchAgentException;

	/**
	* Returns the last agent in the ordered set where status = &#63;.
	*
	* @param status the status
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching agent, or <code>null</code> if a matching agent could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Agent fetchByState_Last(int status,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the agents before and after the current agent in the ordered set where status = &#63;.
	*
	* @param agentId the primary key of the current agent
	* @param status the status
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next agent
	* @throws com.mad.bikepony.NoSuchAgentException if a agent with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Agent[] findByState_PrevAndNext(
		long agentId, int status,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchAgentException;

	/**
	* Returns all the agents.
	*
	* @return the agents
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.mad.bikepony.model.Agent> findAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the agents.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of agents
	* @param end the upper bound of the range of agents (not inclusive)
	* @return the range of agents
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.mad.bikepony.model.Agent> findAll(int start,
		int end) throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the agents.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of agents
	* @param end the upper bound of the range of agents (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of agents
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.mad.bikepony.model.Agent> findAll(int start,
		int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes the agent where agentId = &#63; and password = &#63; from the database.
	*
	* @param agentId the agent ID
	* @param password the password
	* @return the agent that was removed
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Agent removeByAgentIdAndPassword(
		long agentId, java.lang.String password)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchAgentException;

	/**
	* Removes all the agents where status = &#63; from the database.
	*
	* @param status the status
	* @throws SystemException if a system exception occurred
	*/
	public void removeByState(int status)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the agents from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of agents where agentId = &#63; and password = &#63;.
	*
	* @param agentId the agent ID
	* @param password the password
	* @return the number of matching agents
	* @throws SystemException if a system exception occurred
	*/
	public int countByAgentIdAndPassword(long agentId, java.lang.String password)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of agents where status = &#63;.
	*
	* @param status the status
	* @return the number of matching agents
	* @throws SystemException if a system exception occurred
	*/
	public int countByState(int status)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of agents.
	*
	* @return the number of agents
	* @throws SystemException if a system exception occurred
	*/
	public int countAll()
		throws com.liferay.portal.kernel.exception.SystemException;
}